package com.map.database;

import java.sql.SQLException;

public class InsertItem {
	public static void main(String[] args) throws ClassNotFoundException {
		
//		insertToMapTable();
//		insertToVendorsTable();


	}

	private static void insertToVendorsTable() throws ClassNotFoundException, SQLException {
		Database db = new Database();
		db.ConnectApplicationDB();
		for(int i = 1;i<=250;i++){
			db.exceuteQueryStatement("insert into vendors (description,phone,total,paid,balance,vendorGroup,email) values('hello description','000000000',"+(50.0*i/5)+","+(10.0*i/6)+","+(5.0*i/5)+",'government','some@exmaple.com')");
		}
		db.closeDB();
		
	}

	private static void insertToMapTable() throws ClassNotFoundException, SQLException {
		Database db = new Database();
		db.ConnectApplicationDB();
		String mapNames = "";
		String mapTypes = "";
		int j = 1;
		for(int i = 1;i<=250;i++){
			mapNames = "mapName"+Integer.toString(i);
			mapTypes = "mapType"+Integer.toString(j);
			db.exceuteQueryStatement("insert into map (mapName,mapType,costPrice,sellingPrice,quantity) values('"+mapNames+"','"+mapTypes+"',"+(50.0*i/5)+","+(60.0*i/6)+","+(10*i/5)+")");
			if(i%50 == 0)
				j++;
		}
		db.closeDB();
		
	}

}

